const express = require('express')
const router = express.Router()
const orderController = require('../controllers/orderController')

router
  // 提交订单记录
  .post('/', orderController.addOrder)
  // 获取该用户所有订单
  .get('/', orderController.getUserOrder)
  // 获取所有订单
  .get('/all', orderController.getOrder)
  // 标记为已完成
  .post('/completed', orderController.updateOrder)
  // 删除订单
  .delete('/', orderController.deleteOrder)

module.exports = router
